package com.example.library_core.ext

import com.example.library_core.utils.GsonUtils
import com.google.gson.reflect.TypeToken
import java.lang.reflect.Type

/** gson序列化 */
inline fun Any.toJson(includeNulls:Boolean = true):String = GsonUtils.toJson(this,includeNulls)

/**反序列化*/
inline fun <reified T> String.fromJson(type : Type = object : TypeToken<T>(){}.type) : T = GsonUtils.fromJson(this,type)